package com.atguigu.eduservice.entity.enums;

/**
 * @Author panghl
 * @Date 2021/1/9 14:49
 * @Description 删除标识枚举
 **/
public enum DelFlagEnum {

    DELETED(1,"逻辑删除"),
    NOT_DELETED(0,"正常");

    private Integer value;
    private String name;
    DelFlagEnum(Integer value,String name) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public static String getNameByKey(Integer key){
        for (DelFlagEnum vo: DelFlagEnum.values()){
            if (vo.getValue().equals(key)){
                return vo.getName();
            }
        }
        return null;
    }
}
